#pragma once

#include "RenderTypes.h"


struct IVertexBuffer;
struct IIndexBuffer;
struct I2DRender;
struct IFont;

struct IRender
{
	virtual ~IRender() {}

	virtual bool Init() = 0;

	virtual void Update() = 0;
	virtual void PreRender() = 0;
	virtual void Render() = 0;
	virtual void PostRender() = 0;
	virtual void ClearBuffer(uint flags, const Color& color, float z) = 0;

	virtual uint GetWidth() const = 0;
	virtual uint GetHeight() const = 0;

	virtual void SetShader(const char* name) = 0;
	virtual void SetTexture(TextureId texture) = 0;
	virtual void DrawPrimitives(EPrimitiveType ptype, const S2DVertex* vertices, uint16 vertex_count,
		const uint16* indices, uint16 index_count) = 0;
	virtual void DrawPrimitives(EPrimitiveType ptype, const IVertexBuffer* vertices, uint16 vertex_count,
		const IIndexBuffer* indices, uint16 index_count) = 0;

	virtual IFont* GetFont() = 0;
	virtual I2DRender* Get2DRender() = 0;
};
